<?php 
include "phpthumb.filters.php";
include "phpthumb.functions.php";

$img = imagecreatefromjpeg("test.jpg");
$filter= new phpthumb_filters();
$filter->Grayscale($img);

header('content-type: image/jpeg');
imagejpeg($img);
imagedestroy($img);
?>